# -*-coding:utf-8-*-
'''
跳出循环
break 跳出并停止循环
continue 跳出该次循环，但不停止循环
'''
# x = 0
# while x <= 10:
#     if x == 2:  # 死循环
#         continue
#     print(x)
#     x += 1

# nums = [1,2,3]
# for num in nums:
#     if num == 2:
#         continue
#     print(num)
# else:
#     print('cc')

'for 循环 如果能正常结束，或者continue 都会执行else  break 不能一块使用 会跳出循环'

'''
列表推导式
    格式 variable = [out_exp_res for i in input_list if xxx]
        循环 input_list 根据 if 判断   再做out_exp_res 处理
'''
a = [1,2,3]
# b = []
# for i in a:
#     if i % 2 == 0:
#         b.append(i+1)
# print(b)
#
# c = [i+1 for i in a if i % 2 ==0]
# print(c)

def func(i):
    return i * 2
e = [i+1 for i in a if i % 2 == 1]
print(e)

'''

'''